﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcEmrRazor.Controllers
{
    [Authorize]
    public class LookupsController : Controller
    {
        public JsonResult SnowMedDescription()
        {
            var term = Request.QueryString["term"];
            string[] descriptions = new string[] 
            {
                "Cerebrovascular Accident",
			    "Recurrent Urinary Tract Infection",
			    "Chronic Obstructive Lung Disease",
			    "Essential Hypertension"
            };

            var result = (from n in descriptions
                       where n.ToLower().StartsWith(term.ToLower())
                       select n).ToList();

            return Json(result, JsonRequestBehavior.AllowGet);
        }
    }
}
